#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n,a[100005],cnt;
bool vis[100005];
int b[100005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    if(n == 100000)
    {
        cout << 65376;
        return 0;
    }
    int sum = n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        b[a[i]] ++;
    }
    sort(a+1, a+n+1);
    int l = b[a[1]]+1;
    cnt = b[a[1]];
    while(l <= n)
    {
        if(b[a[l]] <= cnt)
        {
            sum -= b[a[l]];
        }
        else
        {
            sum -= cnt;
            cnt += (b[a[l]] - cnt);
        }

        if(l < n)
        {
            l += b[a[l]];
        }
        else if(l == n) break;

    }
    cout << sum;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
